package cn.edu.zzu.demo04ThreadAdvance;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * 线程池
 */
public class TestPool {
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newFixedThreadPool(10);
        executorService.execute(new Print());
        executorService.execute(new Print());
        executorService.execute(new Print());
        executorService.shutdown();
    }
}
class Print implements Runnable{

    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName());
    }
}
